let arr = [1,0,12,3,0];
let brr = []
for(let i = 0 ; i < arr.length ; i++){
    if(arr[i]==0){
        brr.push(arr[i]);
        arr.splice(i,1);
    }
}
let crr = [...arr,...brr]
console.log(arr,brr)
console.log(crr)